﻿@{
    Layout = null;
}
<form id="MaterialForm" method="post" class="form-horizontal" onkeydown="if(event.keyCode==13){return false;}">
    <div class="row">
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right"><span class="red-700">*</span>素材名称:</div>
        <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
            <input class="form-control" type="text" value="" name="MaterialName" placeholder="请输入素材名称" maxlength="50">
        </div>
    </div>

    <div class="row">
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right">素材类型:</div>
        <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
            <select class="form-control" name="MaterialType">
                <option value="0">标准</option>
                <option value="1">黄金</option>
                <option value="2">白金</option>
                <option value="3">钻石</option>
            </select>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right"><span class="red-700">*</span>素材简介:</div>
        <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
            <textarea class="form-control" name="Remark" style="max-width:100%;" id="Remark" placeholder="请输入素材简介" maxlength="50"></textarea>
        </div>
    </div>
</form>
<script>
    $('#MaterialForm').bootstrapValidator({
        fields: {
            MaterialName: {
                validators: {
                    notEmpty: {
                        message: '素材名称不能为空'                  
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '素材名称不能输入符号'
                    },
                    stringLength: {
                        max: 50,
                        message: '素材名称最大长度为50'
                    }
                }
            },
            Remark: {
                validators: {
                    notEmpty: {
                        message: '素材简介不能为空'
                    },
                    stringLength: {
                        max: 50,
                        message: '素材简介最大长度为50'
                    }
                }
            }
        }
    });
</script>